package com.cn.stusy0015.demo005;

import java.util.Scanner;

/**
 * @author lw
 * @ClassName SignUp.java
 * @Description
 * @createTime 2023年05月20日 09:48:00
 */
public class SignUp {
    public static void main(String[] args) {
        System.out.println("***欢迎进入注册系统***");
        Scanner sc = new Scanner(System.in);
        do {
            System.out.print("请输入用户名：");
            String name = sc.next();
            System.out.print("请输入密码：");
            String pwd = sc.next();
            System.out.print("请再次输入密码：");
            String pwdAgain = sc.next();
            if (name.length()<3 || pwd.length() < 6){
                System.out.println("用户名长度不能小于3位，密码长度不能小于6位！");
                continue;
            }else if(!pwd.equals(pwdAgain)){
                System.out.println("两次密码输入不一致！");
                continue;
            }else if (pwd.equals(pwdAgain)){
                System.out.println("注册成功！请牢记用户名和密码。");
                break;
            }
        }while (true);
    }
}
